package main

import (
	"fmt"
)

func main() {
	personSalary := map[string]int{
		"steve": 12000,
		"jamie": 15000,
	}
	personSalary["mike"] = 9000
	employee := "jamie"
	fmt.Println("Salary of", employee, "is", personSalary[employee])

	personSalary1 := map[string]int{
		"steve": 12000,
		"jamie": 15000,
	}
	personSalary1["mike"] = 9000
	employee1 := "jamie"
	fmt.Println("Salary of", employee, "is", personSalary[employee1])
	fmt.Println("Salary of joe is", personSalary["joe"])


	personSalary2 := map[string]int{
		"steve": 12000,
		"jamie": 15000,
	}
	personSalary2["mike"] = 9000
	fmt.Println("All items of a map")
	for key, value := range personSalary2 {
		fmt.Printf("personSalary[%s] = %d\n", key, value)
	}

	personSalary3 := map[string]int{
		"steve": 12000,
		"jamie": 15000,
	}
	personSalary3["mike"] = 9000
	newEmp := "joe"
	value, ok := personSalary3[newEmp]
	if ok == true {
		fmt.Println("Salary of", newEmp, "is", value)
	} else {
		fmt.Println(newEmp,"not found")
	}


}



